package com.kt.oa.oasysteam.controller;

import com.kt.oa.oasysteam.entity.KtEmp;
import com.kt.oa.oasysteam.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Auther: zhuzhuhong
 * @Date: 2019/11/5 14:09
 * @Description:
 */
@Controller
public class UserInfoController {

    @Autowired
    private UserService userService;

    @RequestMapping("/findUserInfo")
    @ResponseBody
    Map<String, Object> findUserInfo(String userName, String companyName) {
        HashMap<String, Object> returnMap = new HashMap<>();
        List<KtEmp> emps = userService.findEmps(userName, companyName);
        if (emps != null) {
            returnMap.put("emps", emps);
        }
        return returnMap;
    }

}
